
<!DOCTYPE html>
<html>
<head>

    <meta charset="UTF-8">
    <title>抢免费装修设计</title>
    <meta name="viewport" content="width=100%; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_604068_w0oek308qmdholxr.css" />
    <script src="/static/js/vue.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery-weui/1.2.0/js/jquery-weui.min.js"></script>
    <script src="/static/js/vue.js"></script>

    <link rel="stylesheet" href="/static/jquery-weui/css/weui.min.css">
    <link rel="stylesheet" href="/static/jquery-weui/css/jquery-weui.css">
    <link rel="stylesheet" href="/static/jquery-weui/css/demos.css">

    <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>

    <link rel="stylesheet" href="http://demo.open.weixin.qq.com/jssdk/css/style.css?ts=1420774989">

    <script src="/static/jquery-weui/js/jquery-2.1.4.js"></script>
    <script src="/static/jquery-weui/js/fastclick.js"></script>

    <script src="/static/jquery-weui/js/jquery-weui.js"></script>

    <style>

        .headTitle {
            position: fixed;
            border: 1px solid #f4f4f4;
            border-top: none;
            border-left: none;
            border-right: none;
            background: #fff;
            width: 100%;
            height: 44px;
            line-height: 44px;
        }

        .head {
            position: absolute;
            width: 100%;
            max-width: 640px;
            right: 0;
            margin: 0 auto;
            height: 44px;
            background: rgb(255, 255, 255);
            top: 0;
            left: 0;
            z-index: 3;
        }

        .head .title1 {
            text-align: center;
            font-size: 17px;
            margin: 0 8%;
            font-style: normal;
            font-weight: normal;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            height: 100%;

        }

        .head a img {
            float: left;
            display: block;
            width: 100%;
            width: 10px;
            height: 16px;
            margin-left: 5%;
            margin-top: 14px;
        }

        .bt {
            margin-top: 15px;
            margin-left: 10%;
            height: 40px;
            line-height: 40px;
            background: rgb(239, 239, 244);
            width: 80%;
            border-radius: 5px;

        }

        .bt1 {
            margin-top: 20px;
            margin-left: 10%;
            height: 42px;
            border-radius: 5px;
            background: #fe8200;
            width: 80%
        }
        .bt input{border: none;
            background: rgb(239, 239, 244);
            width: 80%;
            outline: 0;
        }
        .bt1 button{border: none;
            height: 40px;
            line-height: 40px;
            background: #fe8200;
            width: 80%;
            color: white;
            font-size: 17px;
        }



    </style>

</head>

<body style="background: #ffffcc;">

<header class="head headTitle" style="position: fixed;top: 0px;">
    <a class="back" href="{:url('/home/shouye/shouye')}">
        <img src="/static/images/back_gray.png">
    </a>
    <h6 class="title1" style="line-height: 44px">抢免费装修设计</h6>

</header>

<div>
    <img  style="width: 100%;margin-top: 45px" src="/static/images/0ysj.jpg">
</div>

<div   style="margin-top: 30px;">

    <div  style="width: 85%;border: 1px  solid  white;height: 280px;margin-left: 7%;background: white;text-align: center">
        <div  style="margin-top: 20px"><b>生活因你而美好</b></div>
        <div class="bt"><span  class="icon icon-icon-person"></span> <input  id="name" name="name"   value="" type="text" placeholder="请输入您的姓名"></div>
        <div class="bt"><span  class="icon icon-icon--"></span> <input  id="phone"   name="phone"  value="" type="text" placeholder="请输入您的电话"></div>
        <div class="bt1"   > <button  id="show-toast" type="submit"><span  class="icon icon-liwu"  ></span>  抢先预约</button></div>

    </div>

</div>
</body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script>
    $(".bt1").click(function () {
        if($("input").val()=="" ){
            alert("请将信息填写完整");
        }

        else  if($("input").val() != "" ){
            wx.config({
                debug: false,
                appId: '{$jsconfig.appId}',
                timestamp: '{$jsconfig.timestamp}',
                nonceStr: '{$jsconfig.noncestr}',
                signature: '{$jsconfig.signature}',
                jsApiList: [
                    'checkJsApi',
                    'onMenuShareTimeline',
                    'onMenuShareAppMessage',
                    'onMenuShareQQ',
                    'onMenuShareWeibo',
                    'hideMenuItems',
                    'showMenuItems',
                    'hideAllNonBaseMenuItem',
                    'showAllNonBaseMenuItem',
                    'translateVoice',
                    'startRecord',
                    'stopRecord',
                    'onRecordEnd',
                    'playVoice',
                    'pauseVoice',
                    'stopVoice',
                    'uploadVoice',
                    'downloadVoice',
                    'chooseImage',
                    'previewImage',
                    'uploadImage',
                    'downloadImage',
                    'getNetworkType',
                    'openLocation',
                    'getLocation',
                    'hideOptionMenu',
                    'showOptionMenu',
                    'closeWindow',
                    'scanQRCode',
                    'chooseWXPay',
                    'openProductSpecificView',
                    'addCard',
                    'chooseCard',
                    'openCard'
                ]
            });
            wx.isInit = false;
            wx.ready(function () {
                wx.getLocation({
                    type: 'wgs84', // 默认为wgs84的gps坐标，如果要返回直接给openLocation用的火星坐标，可传入'gcj02'
                    success: function (res) {
                        var latitude = res.latitude; // 纬度，浮点数，范围为90 ~ -90
                        var longitude = res.longitude; // 经度，浮点数，范围为180 ~ -180。
                        var speed = res.speed; // 速度，以米/每秒计
                        var accuracy = res.accuracy; // 位置精度
//               alert(JSON.stringify(res));
                        var name=$("#name").val();
                        var phone=$("#phone").val();
                        $.post('{:url("onlineorder")}', {name:name,phone:phone,latitude:latitude,longitude:longitude,accuracy:accuracy,speed:speed}, function (res) {
                            if (res.code == 1) {
                                $.toast("领取成功", function() {
                                    window.location.href="{:url('home/shouye/shouye')}";
                                });
                            }
                        });
                    }

                });
            })


            wx.error(function (res) {
                alert(res.errMsg);
            });


        }
    });
</script>
</html>

